package com.jxs.android.weiget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.jxs.android.ges.R;

public class Bu_Cst_Relation_Item extends LinearLayout {

	private TextView index,// 序号
			birthday,// 生日

			name,// 关键人名称

			phone,// 联系方式

			type_name;// 职务分类

	public Bu_Cst_Relation_Item(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}

	public Bu_Cst_Relation_Item(Context context) {
		this(context, null);
	}

	private void init(Context context) {
		LayoutInflater.from(context).inflate(R.layout.bu_table_view_cst_relation_item, this);

		index = (TextView) findViewById(R.id.index);
		birthday = (TextView) findViewById(R.id.birthday);
		name = (TextView) findViewById(R.id.name);
		phone = (TextView) findViewById(R.id.phone);
		type_name = (TextView) findViewById(R.id.type_name);
	}

	public void setBackgroud(int resid) {
		index.setBackgroundResource(resid);
		birthday.setBackgroundResource(resid);
		name.setBackgroundResource(resid);
		phone.setBackgroundResource(resid);
		type_name.setBackgroundResource(resid);
	}

	public void setTextColor(int resid) {
		index.setTextColor(resid);
		birthday.setTextColor(resid);
		name.setTextColor(resid);
		phone.setTextColor(resid);
		type_name.setTextColor(resid);
	}

	// titItem.setValue("序号", "关键人名称", "职务分类", "联系方式", "生日");
	public void setValue(String i_index, String i_name, String i_type_name, String i_phone, String i_birthday) {
		index.setText(i_index);
		birthday.setText(i_birthday);
		name.setText(i_name);
		phone.setText(i_phone);
		type_name.setText(i_type_name);
	}

	public void setbirthdayGravityCenter() {
		birthday.setGravity(Gravity.CENTER);
	}

}